import React, {Component, PropTypes} from 'react'
import {Link} from 'react-router'


class Goods extends Component {
    render() {
        const {item} = this.props;
        const imgUrl = item.image ? item.image.split(",")[0] : item.image;
        return (
            <li>
                <Link to={`mall/goodsDetail`} query={{
                    categoryCode: item.categoryCode,
                    goodsNo: item.goodsNo,
                    specificationNo: item.specificationNo
                }}>
                    <img className="mall-goods-list-img" src={imgUrl} alt={item.name}/>
                    <div className="mall-goods-list-text">
                        <div className="mall-goods-list-name">{item.name}</div>
                        <div className="mall-goods-list-price">¥{item.price} <s>¥{item.bazaarPrice}</s></div>
                    </div>
                </Link>
            </li>
        )
    }
}

export default Goods